import request from '@/utils/request';

//河道水情默认查询
export function getyjGrid(data) {
    return request({
        url: `/fxyjyb/common/gridJson`,
        method: 'POST',
    });
}
export function getyjPolygon(data) {
    return request({
        url: `/fxyjyb/common/polygonJson`,
        method: 'POST',
    });
}
export function getyjArea(data) {
    return request({
        url: '/fxyjyb/common/getYjqCountry',
        method: 'post',
        data: data,
    });
}
export function getyjImg(data) {
    return request({
        url: '/fxyjyb/common/getImage',
        method: 'get',
        data: data,
        responseType: 'blob',
    });
}
export function getyjProduct(data) {
    return request({
        url: '/fxyjyb/common/createProduct',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data',
        },
        responseType: 'blob',
    });
}
export function yjfbProduct(data) {
    return request({
        url: `/fxyjyb/common/FbProduct?advcode=${data}`,
        method: 'post',
        data: data,
    });
}
//获取中小河流边界数据
export function getRiverJson(data) {
    return request({
        url: '/fxyjyb/common/riverOutline',
        method: 'post',
        data: data,
    });
}
//获取风险监测阈值
export function getThreshold(data) {
    return request({
        url: '/fxyjyb/common/threshold',
        method: 'post',
        data: data,
    });
}
//预警区分析
export function yjAnalyse(data) {
    return request({
        url: `/fxyjyb/common/getYjqCountry`,
        method: 'POST',
        data: data,
    });
}

//风险监测
//1.地质灾害的固定值或者动态阈值
export async function geologicalDisasterThreshold(option) {
    return await request({
        url: `/fxyjyb/common/geologicalDisasterThreshold`,
        method: 'get',
        params: option,
    });
}
//2.山洪灾害风险
export async function mountainTorrentsThreshold(option) {
    return await request({
        url: `/fxyjyb/common/mountainTorrentsThreshold`,
        method: 'get',
        params: option,
    });
}

//3.中小河流
export async function riverThreshold(option) {
    return await request({
        url: `/fxyjyb/common/riverThreshold`,
        method: 'get',
        params: option,
    });
}

//地质灾害风险地质灾害
export async function geologicalDisasterPicture(option) {
    return await request({
        url: `/fxyjyb/common/geologicalDisasterPicture`,
        method: 'get',
        params: option,
    });
}
//山洪灾害风险 山洪灾害
export async function mountainTorrentsPicture(option) {
    return await request({
        url: `/fxyjyb/common/mountainTorrentsPicture`,
        method: 'get',
        params: option,
    });
}
//山洪灾害风险 模型
export async function mountainTorrentsModel(data) {
    return await request({
        url: `/fxyjyb/common/mountainTorrentsModel?mountainTorrentsModelType=${data}`,
        method: 'get',
        data: data,
    });
}
//地质灾害风险 模型
export async function geologicalDisasterModel(data) {
    return await request({
        url: `/fxyjyb/common/geologicalDisasterModel?geologicalDisasterModelType=${data}`,
        method: 'get',
        data: data,
    });
}
//中小河流 阈值等级
export async function thresholdLevel(data) {
    return await request({
        url: `/fxyjyb/common/riverLevel?riverLevel=${data}`,
        method: 'get',
        data: data,
    });
}
//gridupdate
export function updateGrid(data) {
    return request({
        url: `/dmgis/pws/CallPlugin/model?${data}`,
        method: 'POST',
        data: data,
    });
}
//sdupdateGrid
export function sdupdateGrid(data) {
    return request({
        url: `/dmgis/pws/CallPlugin/model?${data}`,
        method: 'POST',
    });
}
//grid
export function dqyjGrid(data) {
    return request({
        url: `/dmgis/pws/CallPlugin/model${data}`,
        method: 'POST',
    });
}
//gridarea
export function dqyjGridArea(data) {
    return request({
        url: `/dmgis/pws/CallPlugin/model${data}`,
        method: 'POST',
    });
}
